feat(api,ui): showcase workspace restore/replay (#393)#397
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Implements showcase-workspace E4 — restore/replay (closes #393, umbrella #389). The E1
showcase_workspacerows become listable/loadable over two new GET endpoints, and the Showcase page gains workspace controls plus a server-backed panel with Load (re-attach, read-only) and Replay (verbatim re-run through the existing WS path withpreservation="keep").All additive — no migration, no schema change, no
pipeline.py/models.pychanges.Backend
GET /demo/workspaces— paginated list, newest first;200+ empty page on an empty table (mirrorsGET /scenarios).GET /demo/workspaces/{workspace_id}— full row incl.created_objects;404 application/problem+jsonwhen missing.WorkspaceListItem/WorkspaceDetailResponse/WorkspaceListResponseresponse models (plainBaseModel+from_attributes— strict mode stays request-body-only) and acount_workspaceshelper next to the E1 read helpers these routes consume.Frontend
created_objects+ grain columns (winning/V2 runs, scenario plans, batch, alias, grain-scoped forecast/backtest, agent session).setScenariobeforestart— picker-desync gotcha); Replay re-submits the recorded config verbatim and always creates a NEW workspace row.RunHistoryStripnow records ephemeral runs only — a summary carrying aworkspaceIdis not appended (server is source of truth for kept runs).Tests
test_demo_replay_same_config_twice): the identical keep-config runs twice back-to-back — both green, no 409/500 (guards the fix(registry): _find_duplicate raises MultipleResultsFound under detect policy #146_find_duplicateand fix(showcase): make safer promote artifact URI compatible with scenario replay #324 safer-promote fixes), distinct workspace ids, both rows listed as completed.workspaceIdcapture + legacy null), both new panels, and the ephemeral-only strip append. 349 tests green.Docs
docs/_base/API_CONTRACTS.md— two endpoint rows + an E4 note on the WS section (additive; no overlap with E3's edit).Validation
ruff check+ruff format --check+mypy --strict+pyright --strict+pytest -m "not integration"(1975) ✅pnpm lint && pnpm test --run(349) ✅Notes / deferred (per PRP)
replayed_fromprovenance column (needs a migration — possible follow-up).